using System;
using System.Collections.Generic;
using Agriculture.Domain;
using MediatR;

namespace Agriculture.Api.Read.Application.Command
{
    /// <summary>
    /// 挂号订单查询命令
    /// </summary>
    public class RegistrationOrderQuery : IRequest<RegistrationOrderQueryResult>
    {
        /// <summary>
        /// 就诊人姓名或订单号或用户名（用于模糊查询）
        /// </summary>
        public string? SearchKey { get; set; }

        /// <summary>
        /// 开始时间
        /// </summary>
        public DateTime? StartTime { get; set; }

        /// <summary>
        /// 结束时间
        /// </summary>
        public DateTime? EndTime { get; set; }

        /// <summary>
        /// 订单状态（0：全部，1：待支付，2：已完成，3：已取消，4：已退款）
        /// </summary>
        public int? OrderStatus { get; set; }

        /// <summary>
        /// 当前页码
        /// </summary>
        public int PageIndex { get; set; } = 1;

        /// <summary>
        /// 每页大小
        /// </summary>
        public int PageSize { get; set; } = 10;
    }

    /// <summary>
    /// 挂号订单查询结果
    /// </summary>
    public class RegistrationOrderQueryResult
    {
        /// <summary>
        /// 总记录数
        /// </summary>
        public int TotalCount { get; set; }

        /// <summary>
        /// 总页数
        /// </summary>
        public int TotalPages { get; set; }

        /// <summary>
        /// 当前页码
        /// </summary>
        public int CurrentPage { get; set; }

        /// <summary>
        /// 挂号订单列表
        /// </summary>
        public List<RegistrationOrderDto> RegistrationOrders { get; set; } = new List<RegistrationOrderDto>();
    }

    /// <summary>
    /// 挂号订单DTO
    /// </summary>
    public class RegistrationOrderDto
    {
        /// <summary>
        /// 订单编号
        /// </summary>
        public string OrderNo { get; set; }

        /// <summary>
        /// 提交时间
        /// </summary>
        public DateTime SubmitTime { get; set; }

        /// <summary>
        /// 用户名
        /// </summary>
        public string UserName { get; set; }

        /// <summary>
        /// 科室
        /// </summary>
        public string Department { get; set; }

        /// <summary>
        /// 医生
        /// </summary>
        public string Doctor { get; set; }

        /// <summary>
        /// 挂号费用
        /// </summary>
        public decimal RegistrationFee { get; set; }

        /// <summary>
        /// 订单状态（待支付/已完成/已取消/已退款）
        /// </summary>
        public string OrderStatus { get; set; }
    }
} 